Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel block verification #2015

Merged
merged 1 commit into from
Sep 29, 2023
Merged

Parallel block verification #2015

merged 1 commit into from
Sep 29, 2023

Conversation

nazar-pc
Copy link
Member

@nazar-pc nazar-pc commented Sep 28, 2023

Now that Substrate was upgraded in #2010 and parallel block verification is available (though upstream PR paritytech/polkadot-sdk#1598 is stuck), this PR takes advantage of it while accounting for two edge-cases: equivocation and runtime API call concurrency.

Code contributor checklist:

Base automatically changed from farmer-thread-pools to main September 28, 2023 09:09
crates/sc-consensus-subspace/src/verifier.rs Show resolved Hide resolved
use tokio::sync::Semaphore;

/// This corresponds to default value of `--max-runtime-instances` in Substrate
const BLOCKS_LIST_CHECK_CONCURRENCY: usize = 8;
Copy link
Member

@vedhavyas vedhavyas Sep 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe MAX_CONCURRENT_BLOCK_VERIFICATIONS?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really, the verification is running at higher concurrency, this is just for block list check that requires runtime API calls and is bound by number of runtime instances.

@nazar-pc nazar-pc added the need to audit This change needs to be audited label Sep 29, 2023
@nazar-pc nazar-pc merged commit 26e6a7e into main Sep 29, 2023
10 checks passed
@nazar-pc nazar-pc deleted the parallel-block-verification branch September 29, 2023 04:43
@vanhauser-thc vanhauser-thc added audited This change was audited and removed need to audit This change needs to be audited labels Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audited This change was audited
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants